﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Commnications
{
    public class EasyResult
    {
        public EasyResult(uint code,string msg)
        {
            Code = code;
            IsSuccess = code == 0;
            Message = msg;
        }
        public EasyResult(object data):this(0,string.Empty)
        {
            WrapData = data;
        }
        public EasyResult(bool isSuccess) : this(isSuccess, null)
        {
        }
        public EasyResult(bool isSuccess, object data)
        {
            IsSuccess = isSuccess;
            Message = string.Empty;
            WrapData = data;
        }
        /// <summary>
        /// 状态
        /// </summary>
        public bool IsSuccess { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public object WrapData { get; set; }
        /// <summary>
        /// 状态码
        /// </summary>
        public uint Code { get; set; }
    }
}
